From: Ewan Mellor Date: Fri, 23 Mar 2007 17:51:24 +0000 (+0000) Subject: Workaround buggy GCCs wrt strftime. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15277^2~12 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=7984b6bc71576c3224060f1fd376e1da093c9308;p=xen.git Workaround buggy GCCs wrt strftime. Signed-off-by: Ewan Mellor --- diff --git a/tools/libxen/test/test_bindings.c b/tools/libxen/test/test_bindings.c index c709e64867..922518fe8a 100644 --- a/tools/libxen/test/test_bindings.c +++ b/tools/libxen/test/test_bindings.c @@ -572,6 +572,16 @@ static void print_vm_power_state(xen_session *session, xen_vm vm) } +/** + * Workaround for whinging GCCs, as suggested by strftime(3). + */ +static size_t my_strftime(char *s, size_t max, const char *fmt, + const struct tm *tm) +{ + return strftime(s, max, fmt, tm); +} + + /** * Print the metrics for the given VM. */ @@ -594,7 +604,7 @@ static void print_vm_metrics(xen_session *session, xen_vm vm) char time[256]; struct tm *tm = localtime(&vm_metrics_record->last_updated); - strftime(time, 256, "Metrics updated at %c, local time.\n", tm); + my_strftime(time, 256, "Metrics updated at %c, local time.\n", tm); printf(time); for (size_t i = 0; i < vm_metrics_record->vcpus_utilisation->size; i++)